package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;

@Mapper
public interface UserMapper {

    /*
    * 根据openid查询用户
    * */
    @Select("SELECT * FROM user WHERE openid = #{openId}")
    User selectUser(String openId);

    /*
    * 插入用户
    * */
    void insert(User user);
    @Select("SELECT * FROM user WHERE id = #{userId}")
    User getById(Long userId);

    Integer getUserTotalByDate(LocalDateTime beginTime, LocalDateTime endTime);
}
